package com.gopher.gopherbeasts;

public class Mth{
	public static int clamp(int value, int low, int high) {
		if (value < low)
			return low;
		return value > high ? high : value;
	}
	public static float clamp(float value, float low, float high) {
		if (value < low)
			return low;
		return value > high ? high : value;
	}
	
	public static float clamp(float value, float plusminus) {
		if (plusminus < 1) {
			plusminus *= -1;
		}
		if (value < -plusminus)
			return -plusminus;
		return value > plusminus ? plusminus : value;
	}
	
	
}
